package com.longer.playhelper.modle.biz;

import com.longer.playhelper.modle.bean.Bug;

import cn.bmob.v3.exception.BmobException;
import cn.bmob.v3.listener.SaveListener;

/**
 * Created by longer on 2017/7/20.
 */

public class BugBiz implements Bug.BugBiz {
    @Override
    public void onsendbug(String content, String tel, final Bug.OnSendBug onSendBug) {
        Bug bug = new Bug();
        bug.setContent(content);
        bug.setTel(tel);
        bug.save(new SaveListener<String>() {
            @Override
            public void done(String s, BmobException e) {
                if(e == null){
                    onSendBug.Success();
                }else{
                    onSendBug.Failed(e.getMessage());
                    e.printStackTrace();
                }
            }
        });
    }
}
